package com.example.springboot.controller;

import com.example.springboot.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RequestMapping("/teacher")
@RestController
@Slf4j
public class TeacherController {


    @Autowired
    private TeacherService teacherService;

    @RequestMapping("/test")
    public void test(HttpSession session) {
        log.info("当前线程：" + Thread.currentThread().getName());
        teacherService.test();
    }

    @RequestMapping("/login")
    public void login(HttpSession session) {
        session.setAttribute("login", "test");

    }
}
